<form class="layui-form layui-card" data-table-id="MerchantTable" action="{:sysuri()}" data-auto="true" method="post">

    <div class="layui-card-body">

        <!-- 商家名称 -->
        <div class="layui-form-item">
            <label class="layui-form-label">卡座名称</label>
            <div class="layui-input-block">
                <input name="name" value='{$vo.name|default=""}' required lay-verify="required" placeholder="请输入卡座名称" class="layui-input">
            </div>
        </div>

        <!--{notempty name='merchant_list'}-->
        <div class="layui-form-item">
            <label class="layui-form-label"><b>所属商家</b></label>
            <div class="layui-input-block">
                <select class="layui-select"  required lay-verify="required" lay-search name="mid">
                    {foreach $merchant_list as $merchant}
                    {if isset($vo.mid) && $vo.mid == $merchant.id}
                        <option selected value="{$merchant.id}">{$merchant.name}</option>
                    {else}
                    <option value="{$merchant.id}">{$merchant.name}</option>
                    {/if}{/foreach}
                </select>
            </div>
           
        </div>
        <!--{/notempty}-->

        <!-- 商家图片 -->
        <div class="layui-form-item">
            <label class="layui-form-label">图片</label>
            <div class="layui-input-block">
                <input name="thumb" type="hidden" value="{$vo.thumb|default=''}">
            </div>

            <script>$('[name="thumb"]').uploadOneImage()</script>
        </div>

        <!-- 联系人 -->
        <div class="layui-form-item">
            <label class="layui-form-label" >最大人数</label>
            <div class="layui-input-block">
                <input name="max_num" required lay-verify="required" value='{$vo.max_num|default=""}' placeholder="请输入最大人数" class="layui-input">
            </div>
        </div>

        <!-- 联系方式 -->
        <div class="layui-form-item">
            <label class="layui-form-label">价格(小时)</label>
            <div class="layui-input-block">
                <input name="price" required  lay-verify="required|number" value='{$vo.price|default=""}' placeholder="请输入价格" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input name="sort" value='{$vo.sort|default="0"}' placeholder="请输入排序" class="layui-input">
            </div>
        </div>

    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" lay-submit type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>

{block name='script'}
<script>
    // 这里可以添加一些自定义的JavaScript代码
</script>
{/block}